<?php

class ServidorController extends Zend_Controller_Action
{

    public function indexAction()
    {
        $model = new Servidores();
        $grid = $this->_helper->BvbGrid->grid($model,'grid_servidores');
        $grid->setColumnsHidden(array('id'));
        $grid->updateColumn('matricula', array('render' => 'int','title'=>'matrícula')); 
        $grid->updateColumn('cargo_id', array('title'=>'Cargo')); 
        $grid->updateColumn('lotacao_id', array('title'=>'Lotação')); 
        $grid->updateColumn('classe_id', array('title'=>'Classe')); 
        $grid->setNumberRecordsPerPage(10); 
        $grid->setShowFiltersInExport(true); 

        $filters = new Bvb_Grid_Filters(); 
        $filters->addFilter('nome', array('distinct' => array('field' => 'nome', 'name' => 'Nome','order'=>'nome ASC'))); 
        $filters->addFilter('nome',array('render'=>'text')); 
        $filters->addFilter('matricula',array('render'=>'text')); 
        $filters->addFilter('cargo_id', array('distinct' => array('field' => 'cargo_id', 'name' => 'cargo_id'))); 
        $filters->addFilter('classe_id', array('distinct' => array('field' => 'classe_id', 'name' => 'classe_id'))); 
        $grid->addFilters($filters); 

        $this->view->pages = $grid->deploy();
    }        
        
        
}

